﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace BlackStar
{
    class Screen : Component
    {
        public void LoadComponents(ContentManager Content, string contentName)
        {
            Children = Content.Load<List<Component>>(contentName);
            foreach (Component c in Children) c.Parent = this;
        }

        public override void Draw()
        {
            DrawComponents();
        }

        public override void Update(GameTime gameTime)
        {
            UpdateComponents(gameTime);
        }

        protected override void UpdateRectangles()
        {
            myDockSpace = this.Interior;
            //myDockSpace.X = 0;
            //myDockSpace.Y = 0;
            //myDockSpace.Width = gui.GraphicsDevice.Viewport.Width;
            //myDockSpace.Height = gui.GraphicsDevice.Viewport.Height;
            // this component has no parent
        }

        public override Rectangle Interior 
        { 
            get
            {
                return new Rectangle(0, 0, gui.GraphicsDevice.Viewport.Width, gui.GraphicsDevice.Viewport.Height);
            }
        }

    }
}
